home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************************************/
- /* */
- /* Module Name: TeleGestalt */
- /* */
- /* File Name: TeleGestalt.c */
- /* */
- /* © Apple Computer, Inc. 1994-1995 */
- /* All Rights Reserved */
- /* */
- /* Revision History: */
- /* */
- /* Date Who Modification */
- /* */
- /* 1994-10-26 Jaakko Railo Original version */
- /* */
- /************************************************************************************************/
-
- /****************************************** DESCRIPTION ******************************************
-
- *************************************************************************************************/
-
- /******************************************** HEADERS *******************************************/
-
- #ifndef __GESTALT__
- #include "Gestalt.h"
- #endif
-
- #ifndef __TOOLUTILS__
- #include "ToolUtils.h"
- #endif
-
- #ifndef __TELEPHONES__
- #include "Telephones.h"
- #endif
-
- #include "TestModule.h"
-
- /****************************************** DEFINITIONS *****************************************/
-
- #if defined(powerc) || defined (__powerc)
- #pragma options align=mac68k
- #endif
- struct FeatureStructure {
- char *name;
- short feature;
- };
- #if defined(powerc) || defined(__powerc)
- #pragma options align=reset
- #endif
-
- typedef struct FeatureStructure FeatureStructure;
-
- /****************************************** PROTOTYPES ******************************************/
-
- void DoTest (CHRSPtr paramPtr);
-
- /************************************************************************************************/
- /************************************************************************************************/
-
-
- pascal short TestModule (CHRSPtr paramPtr)
- {
- short returnValue = noErr;
-
- if (paramPtr->version <= kTestModuleVersion) {
-
- DoTest (paramPtr);
-
- }
- else
- returnValue = kWrongVersion;
-
- return (returnValue);
- }
-
-
- void DoTest (CHRSPtr paramPtr)
- {
- OSErr errCode;
- long response;
- Boolean supportsIt;
- short index;
- FeatureStructure array[] = {
- { "gestaltTeleMgrPresent", gestaltTeleMgrPresent },
- { "gestaltTeleMgrPowerPCSupport", gestaltTeleMgrPowerPCSupport },
- { "gestaltTeleMgrSoundStreams", gestaltTeleMgrSoundStreams },
- { "gestaltTeleMgrAutoAnswer", gestaltTeleMgrAutoAnswer },
- { "gestaltTeleMgrIndHandset", gestaltTeleMgrIndHandset },
- { "gestaltTeleMgrSilenceDetect", gestaltTeleMgrSilenceDetect },
- { "gestaltTeleMgrNewTELNewSupport", gestaltTeleMgrNewTELNewSupport }
- };
-
-
- if ((errCode = Gestalt (gestaltConnMgrAttr, &response)) == noErr) {
- supportsIt = BitTst (&response, 31 - gestaltConnMgrPresent);
- Print (paramPtr, "%s %s", (supportsIt?"√":" "), "gestaltConnMgrPresent");
- }
-
- for (index = 0; index < (sizeof(array) / sizeof(FeatureStructure)); ++index) {
- if ((errCode = Gestalt (gestaltTeleMgrAttr, &response)) == noErr) {
- supportsIt = BitTst (&response, 31 - array[index].feature);
- Print (paramPtr, "%s %s", (supportsIt?"√":" "), array[index].name);
- }
- else
- Print (paramPtr, "### Gestalt failed : %d", errCode);
- }
- }
-